package zt.song.boot.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import zt.song.boot.interceptor.MyInterceptor;
import zt.song.boot.interceptor.TwoInterceptor;

/**
 * @Author 宋伟宁
 * @Date 2023/11/8
 * @Version 1.0
 **/
@Configuration
public class MvcConfig implements WebMvcConfigurer {


    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
         //配置要上传的文件的路径
        registry.addResourceHandler("/static/upload/**")
                 //配置要显示的静态资源的绝对路径
                .addResourceLocations("file:D:\\idea_space\\spring boot\\2306\\boot110801\\src\\main\\resources\\static\\upload\\");
    }
}
